//index.js
const Controllers = require('../../controllers/Controller.js').controller;
const app = getApp();
Page({
  data: {
    shopId: '',
    rowData: [
      {
        laber: '商业类型：',
        value: '美业',
        key: 'typeName'
      },
      {
        laber: '行业标签：',
        value: '美容护肤 / 汽车保养 / 汽车美容',
        key: 'label'
      },
      {
        laber: '商户名称：',
        value: '门店名称门店名称门店名称门店名称',
        key: 'shopName'
      },
      {
        laber: '商户地址：',
        value: '门店地址门店地址门店地址门店地址门店地址门店地址门店地址门店地址',
        key: 'address'
      },
      {
        laber: '商户负责人：',
        value: '张三',
        key: 'adminName'
      },
      {
        laber: '联系电话：',
        value: ' 15512312312',
        key: 'mobile'
      },
    ]
  },
  shopDetails() {
    var that = this;
    var shopId = that.data.shopId;
    Controllers.shopDetails({shopId}).then(res => {
      console.log('shopDetails--res==', res);
      const { code, data, desc } = res;
      that.setData({
        shopData: data
      })
    })
  },
  onLoad(option) {
    console.log('option', option);
    
    var that = this;
    that.setData({
      shopId: parseInt(option.id)
    })
  },
  onShow() {
    var that = this;
    that.shopDetails();
  }
})